Copyright: Copyright © ArGo Software Design, 1996, 1997


Contents
The Internet Mail Suite

Main units	components	classes

The Internet mail suite contains the package of components which allows you to add the Internet mail send-receive capabilities to your applications quickly and easily.

All components included in The Internet Mail Suite are written in Delphi.  There is no need to deploy any OCXs or DLLs when distributing your programs.  You also don't have to worry how to handle binary attachments: fast and virtually unlimited MIME and UUCode encoding/decoding is built in.

The components included in this package are based on the award winning TSMTP and TPOP3 components, released by ArGo Software Design in March 1996.  We considered big amount of suggestions and ideas which came from the users of these components and created the brand new package, which should suit everyone.

In January 1997 the Internet Mail Suite received Torry's Top Award from Torry's Delphi Pages, Russia.

The Internet Mail Suite contains components related to the Internet mail. TmsSMTP and TmsPOP components allow you to send and receive the Internet mail.  They implement the Simple Mail Transfer Protocol (SMTP, rfc 821) and the Post Office Protocol, version 3 (POP3, rfc 1225).  All the work related to the messages themselves is up to the TmsMessage component, which, by itself is the implementation of a standard rfc822 message.  By single method call you can encode/decode all attachments, store the message in the standard format which is completely compatible with new Microsoft(R) Internet Mail.  Size of attachments is now limited only by the memory of your computer, it means 900KB limit, which existed in TSMTP and TPOP3 components now is gone - TmsMessage component now does not use TStringList class when decoding the attachments - it uses new TLineStream object, which now can hold up to 2GIGs of data.

Another new component is TmsRemotePOP.  You can use this component to retrieve the messages selectively.  Your application now can log into the POP server, gather the information about messages waiting there and retrieve or delete them selectively, based on the criteria defined by your application.  These criteria can be the size of the message, name of the sender, subject, sending date and time which, by the way, can be retrieved in the Delphi TDateTime format. Actually, your application can look up for any information contained in the message headers.  Then, after you retrieve messages, you can load them into TmsMessage component and you are done - all the properties of the TmsMessage component are filled, attachments are decoded.  Please refer to the file tutorial.doc for samples how to work with the components.

TagRas component (included only in 32 bit version) allows you to control windows Dial-Up connection.  It is really very easy to use.  TagRas implements Windows Remote Access Services (RAS) API.  You can now control your connection to the remote services programmatically, without using windows standard connect dialog boxes.

We also included one more component in this package - TagHTTP, implementation of the Hyper Text Transfer Protocol (rfc 1945).  This one is not related to the Internet mail, but is still very useful :-).  It allows you to retrieve any file from the WWW.  From version 1.3 TagHTTP component supports proxy servers.

You also can get the Internet Mail Suite Plus, which, on top of the components mentioned above contains following components:

TmsNNTP - gives you an access ot the Usenet Newsgroups;

TagFTP - Implementation of file transfer protocol;

TagFinger - implements Finger protocol, which allows you to get the information about Internet users;

TagWhoIs - WhoIs protocol, aka Nickname.  You can search Internet directory databases;

TagTime - Network time protocol - synchronize the clocks on the network.

Starting from version 1.5 The Internet Mail Suite is compatible with Borland C++ Builder.  If you have the BCB version of The Internet Mail Suite, then you already have the sample programs, if you have Delphi version, you can download BCBuilder versions of sample applications from ArGo Software Design web page at http://www.argosoft.com.

Some our customers contributed the components which are working in conjunction with The Internet Mail Suite, such as PGP shell component (Wolfgang Stehle) and TmsMessage printer component (Ronald Bonneveld).  You can download them from http://www.argosoft.com/ims3rd.html.

This help file is not final.  We will be updating it according to the questions and inquiries we receive from users.  After each update the help file will be sent to all registered users.

Installation

License agreement

How to register

Contact Information

Acknowledgments


TmsMailAddress class

unit msMsgCls;

declaration

  TmsMailAddress = class(TPersistent)

  private

    FName : ShortString;

    FAddress : ShortString;

  public

    procedure Assign(Value : TmsMailAddress);

    procedure Edit; virtual;

    procedure Clear;

  published

    property Name : ShortString read FName write FName;

    property Address : ShortString read FAddress write FAddress;

  end;

description

TmsMailAddress contains just two properties, Address and Name, where address is the Internet address and Name is the name of sender, recipient or the member of CC or BCC list.

Usually, when assigning the values, Name can be omitted, but Address has to be entered.


TmsAddressList class

unit msMsgCls;

declaration

  TmsAddressList = class(TPersistent)

  private

    FList : TList;

    function GetItem(Index : Integer) : TmsMailAddress;

    procedure SetItem(Index : Integer; Value : TmsMailAddress);

    function GetCount : Integer;

    procedure ReadData(Reader : TReader);

    procedure WriteData(Writer : TWriter);

  protected

    procedure DefineProperties(Filer : TFiler); override;

  public

    constructor Create;

    destructor Destroy; override;

    function Add(Value : TmsMailAddress) : Integer;

    function AddAddress(const TheAddress, TheName : string) : Integer;

    procedure Clear;

    procedure Delete(Index : Integer);

    procedure Assign(Value : TmsAddressList);

    property Count : Integer read GetCount;

    property Items[Index : Integer] : TmsMailAddress read GetItem write SetItem; default;

  end;

description

List of TmsMailAddress objects.  Contains methods and properties for handling these lists.  To add new mail address to the list use Add or AddAddress method, also contains routines for clearing, deleting and maintaining the addresses.  This is the type of Recipients, CC and BCC properties of TmsSMTP component.


TmsAttItem properties

Contents

ContentType

ContentTransferEncoding

FileName


Contents property

unit

msMsgCls;

applies to

TmsAttItem class

declaration

property Contents : TMemoryStream;

description

Contains the contents of the attachment.  It can binary data, such as a contents of the jpeg picture, or text.


Clear method (TmsMessage)
Clear method (for TmsMessage component)

example

unit

msMsg

applies to

TmsCustomMessage component

declaration

procedure Clear;

description

Clears all the contents of the TmsMessage component, resets the counts of all lists to zero and disposes all allocated memory.  If you wish to send different messages in a row, you have to call this method, otherwise, if you add new objects to the list properties, old values will be not cleared.  For example, if you are sending the message with the file attached, then you want to send another message to another recipient with another attachment, you have to call this method after sending first message, otherwise, if you use Attachments.AddFile method, old attachment will be not discarded and both attachments will be sent to second recipient.


TmsAttItem class

properties

unit

msMsgCls

declaration

  TmsAttItem = class(TPersistent)

description

Encapsulates the Internet mail attachment.  The contents of the attachment is contained in the Contents property, FileName property is the name of the file attachment.  ContentType is the MIME type, it is assigned automatically.  If you are using the 32 bit version, data will be taken from Windows registry.  You still have a chance to change it.  The same ContentTransferEncoding property.


TmsAttList class

unit msMsgCls;

declaration

  TmsAttList = class(TPersistent)

  private

    FList : TList;

    function GetItem(Index : Integer) : TmsAttItem;

    procedure SetItem(Index : Integer; Value : TmsAttItem);

    function GetCount : Integer;

    procedure ReadData(Reader : TReader);

    procedure WriteData(Writer : TWriter);

  protected

    procedure DefineProperties(Filer : TFiler); override;

  public

    constructor Create;

    destructor Destroy; override;

    function Add(Value : TmsAttItem) : Integer;

    function AddFile(const FileName : string) : Integer;

    procedure Clear;

    procedure Delete(Index : Integer);

    procedure Assign(Source : TPersistent); override;

    procedure Exchange(Index1,Index2 : Integer);

    property Count : Integer read GetCount;

    property Items[Index : Integer] : TmsAttItem read GetItem write SetItem; default;

  end;

description

The list of TmsAttItem objects.  This is the type of the Attachments property of TmsMessage component.


TmsHeaders class

methods

unit msMsgCls;

declaration

  TmsHeaders = class(TStringList)

description

Implements Internet message headers.  This is the type of the Headers property of TmsMessage component. Contains the methods for parsing and retrieving field values.  You can use these methods when you are looking for some specific values for marking the messages for retrieving or deleting.


classes

TagSocket

TmsMailBase

TmsCustomPOP

TmsMessageList

TmsMailAddress

TmsAddressList

TmsAttItem

TmsAttList

TmsHeaders

TmsRemoteInfoItem

TmsRemoteInfo


TmsMessage component

properties	methods

unit msmsg

declaration

  class TmsMessage(TmsCustomMessage);

description

TmsMessage component is one of the key components of The Internet Mail Suite. This is a powerful encapsulation of rfc822 message (message in standard Internet format).  You just assign the values to the properties at runtime or using the Object Inspector, then run SaveToFile or SaveToStream methods and your message is ready to go!!! Or vise versa, load the rfc822, MIME encoded message, using TmsMessage.LoadFromFile or LoadFromStream method and it will be decoded (if it is possible) and all the properties of TmsMessage component will be filled in.  Now you can save the attachments calling SaveAttachment method, execute them, using ExecuteAttachment method, store the messages into the mailboxes, reply to the sender and so on.


TmsMessage properties

Attachments

BCC

Body

CharSet

CC

ContentType

Encoding

Headers

Recipients

ReturnReceipt

Priority

Sender

Subject


TmsMessage methods

Assign

Clear

ExecuteAttachment (32 bit only)

LoadFromStream

LoadFromFile

SaveAttachment

SaveToFile

SaveToStream

Verify


TmsSMTP component

properties	methods	events

unit mssmtp

declaration

TmsSMTP = class(TmsMailBase)

description

Implements Simple Mail Transfer Protocol, described in rfc821.  Use TmsSMTP component to send Internet mail.  Use Server property to set the a dress of the SMTP server for sending outgoing messages, MailMessage property is the message which will be sent if you run Send method.


TmsSMTP component properties

DefaultPort

LogFileName

MailMessage

RAS  (32 bit only)

Server

OnLine

TimeOut

WinsockAvailable

WinsockLoaded


TmsSMTP methods

Cancel

CloseConnection

OpenConnection

Reset

Send

SendMessage

WriteLogFile


TmsSMTP events

OnCancel

OnClosed

OnClosing

OnError

OnMailSent

OnOpen

OnPrepare

OnProgress

OnSending


TmsPOP component

properties	methods	events

unit mspop3;

declaration

TmsPOP = class(TmsCustomPOP);

description

Implements Post Office Protocol, version 3 (rfc 1225). Use TmsPOP component to retrieve the Internet mail messages from POP3 server.  To retrieve all messages, call RetrieveAllMessages method.  To retrieve the messages selectively, by number, use RetrieveMessage method.  TmsPOP also includes the methods for deleting messages on the server.  All received messages will be stored in the MessageList property.  Each member of MessageList is TmsMessage, so you can use all methods and properties which apply to TmsMessage component to handle retrieved messages..


TmsPOP properties

DefaultPort

LogFileName

MessageList

OnLine

RAS (32 bit only)

Password

UserName

TotalMessages

TotalOctets

WinsockAvailable

WinsockLoaded


TmsPOP methods

Cancel

CloseConnection

DeleteMessage

OpenConnection

RetrieveAllMessages

RetrieveMessage

WriteLogFile


TmsPOP events

OnCancel

OnClosed

OnClosing

OnDeleting

OnError

OnOpen

OnProgress

OnRetrieved

OnRetrieving


TmsRemotePOP component

properties	methods	events

unit mspop3;

declaration

TmsRemotePOP = class(TmsCustomPOP);

description

TmsRemotePOP component is similar to TmsPOP component, but it is more powerful.  It allows to retrieve the messages selectively.  You run UpdateRemoteInfo method, which will fill the RemoteInfoProperty, which is a list of TmsRemoteInfoItem objects, which, on the other side is a list of Internet mail headers.  Each list corresponds to the messages located on the server.  You can parse this information and decide what to do with messages located on the server.  You can handle them selectively, before retrieving from the server, you can retrieve messages you need and delete the messages you don't, or just leave them on the server for later handling.


TmsRemotePOP properties

DefaultPort

KeepAlive

LogFileName

MessageDirectory

OnLine

RAS (32 bit only)

RemoteInfo

Server

TimeOut

TotalMessages

TotalOctets

WinsockAvailable

WinsockLoaded


TmsRemotePOP methods

Cancel

CloseConnection

DeleteMessage

MarkToDelete

MarkToRetrieve

OpenConnection

Reset

RetrieveMessage

Transfer

UpdateRemoteInfo

WriteLogFile


TmsRemotePop events

OnCancel

OnClosed

OnClosing

OnDataTransferred

OnDeleting

OnError

OnInfoUpdated

OnNextInfoUpdated

OnOpen

OnProgress

OnRetrieving

OnRetrieved

OnTransferringData

OnUpdatingInfo

OnUserMessageSave


MessageDirectory property

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property MessageDirectory : string;

description

Directory where the messages will be saved after executing of the RetrieveMessage method of TmsRemotePOP component.  The messages will be saved as msg_##.eml, where ## is the number of the message on the server.


TmsMessageList class

unit

msmsg;

declaration

TmsMessageList = class(TPersistent);

description

This is a list of TmsMessage components.  Includes the methods for adding and deleting the Items to the list.  It is the type of the MessageList property of the TmsPOP component.


clear example
The following code clears all fields of msMessage1:

msMessage1.Clear;


SaveToStream method

unit

msMsg

applies to

TmsCustomMessage component

declaration

procedure SaveToStream(AStream : TStream);

description

prepares rfc822 (ready-to-go) message, i.e. encodes all attachments, prepares all necessary mail headers and saves the output into the stream.  If you wish to save the message into the file, use SaveToFile method.


SaveToFile method

example

unit

msMsg;

applies to:

TmsCustomMessage component;

declaration

procedure SaveToFile(const FileName : string);

description

prepares rfc822 (ready-to-go) message, i.e. encodes all attachments, prepares all necessary mail headers and saves the output into the file with name FileName.  If you wish to save the message into the stream, use SaveToStream method.


SaveToFile example
The following code saves prepares the email message and saves it into the file c:\temp\msg.eml

msMessage1.SaveToFile('c:\temp\msg.eml');


LoadFromStream method

unit

msMsg

applies to

TmsCustomMessage component

declaration

procedure LoadFromStream(AStream : TStream);

description

Loads the raw email message, received from server, decodes attachments and fills in the fields of TmsMessage object.  If an error occurs while decoding the data, the entire original message will be saved as the next available attachment and in the body of message will appear the warning. If you have the raw email message in the file, use LoadFromFile method.  LoadFromStream method used internally by latter.


LoadFromFile method

example

unit

msMsg

applies to

TmsCustomMessage component

declaration

procedure LoadFromFile(const FileName : string);

description

Loads the raw email message received from server, decodes attachments and fills in the fields of TmsMessage object.  If an error occurs while decoding the data, the entire original message will be saved as the next available attachment and in the body of message will appear the warning. If you have the raw email message in the stream, use LoadFromStream method.


LoadFromFile example
Say we just retrieved the message from the server and saved it as file c:\temp\msg.eml. The following line of code:

msMessage1.LoadFromFile('c:\temp\msg.eml');

will load the data, fill in all properties of msMessage1 and decodes all attachments.


SaveAttachment method

unit

msMsg

applies to

TmsCustomMessage component

declaration:

procedure SaveAttachment(Index : Integer; const Path : string);

description

Saves the attachment # Index (zero based) into the specified directory.  If attachment # Index does not exist, EListError exception will be raised.  To the file will be assigned the name msMessage.Attachments[Index].FileName.


ExecuteAttachment method

32 bit version only!

unit

msMsg

applies to

TmsCustomMessage component

declaration

procedure ExecuteAttachment(Index : Integer);

description

executes the attachment # Index.  Calls ShellExecute windows API function, which checks if there is some action associated with 'open'-ing of the attached file and executes it.  The files are temporarily saved in the temporary directory and are deleted when destroying TmsMessage component.


Attachments property

example

unit

msMsg

applies to

TmsCustomMessage component

declaration

property Attachments : TsmAttList;

description

Contains a list of attachments.  Use Attachments property to access the individual attachment.


Attachments example
The following code displays the Content-Type of the 1st attachment as a caption of Label1

Label1.Caption:=msMessage.Attachments[0].ContentType


BCC property

example

unit

msMsg

applies to

TmsMessage component

declaration

property BCC : TmsAddressList

description

Contains a list of Blind carbon copy recipients of the msMessage component.  Blind copy recipients are almost the same as Carbon copy recipients (property CC), only difference is the names listed in BCC will not appear in the message.  Hence if the msMessage corresponds to the message which has been received, BCC list will be empty.


BCC example
The following line of code adds the recipient to the Blind carbon copy list.  The name of the recipient is John Doe, the address - jdoe@domain.com

msMessage1.BCC.AddAddress('jdeo.domain.com','John Doe')

See also examples for CC and Recipients properties


CC property

example

unit

msMsg

applies to

TmsMessage component

declaration

property CC : TmsAddressList

description

Contains a list of carbon copy recipients of the msMessage component.  The names listed here will be included in the outgoing message.  If you want to send a message to someone, but not to include his/her name and address in the headers of the message, use BCC property.


CC example
The following code adds the name and address to the list of CC recipients

msMessage.CC.Add('argosoft@interlog.com','ArGo Software Design');

see also examples for BCC and Recipients properties.


Body property

unit

msMsg

Applies to:

TmsCustomMessage component;

declaration

property Body : TStrings;

description

This is a body of the message itself.  If typed the message in memo1 and want to send its contents as email message, the following code will do it:

msMessage.Body:=Memo1.Lines;


CharSet property

unit

msMsg;

applies to:

TmsCustomMessage component;

declaration

property CharSet : TCharSet;

description

This property will be useful for European users. Default this property is set to csUSAASCII, if you wish to use high ASCII characters (ASCII>128) in your message body, you should set CharSet property to csISO8859.  In this case the Content-type header generated by TmsMessage will indicate that your application uses ISO-8859-1 character set and the body of the message will be encoded using Quoted-Printable method.


TCharSet type

Unit

msMsgCls

Declaration

TCharSet = (csUSASCII,csISO8859);

Description

a type of CharSet property of the TmsMessage component.  Indicates which character set is to be used when encoding the message body.


Subject property

unit

msMsg;

applies to

TmsCustomMessage component

declaration

property Subject : string;

description

A subject line of the mail message or newsgroup article.


Sender property

example

unit

msMsg

applies to:

TmsCustomMessage component;

declaration

property Sender : TmsMailAddress;

description

Contains the address and name of sender.  If sending the message, you have to fill in at least the Address property of, otherwise the message will be not sent.


Sender example
The following code sets the address of sender:

msMessage.Sender.Address:='jdoe@domain.com';

msMessage.Sender.Name:='John Doe';


Priority property

unit

msMsg

Applies to:

TmsMessage component;

declaration

property Priority : TPriority;

description

Indicates the priority of message. It will work only if receiver agent supports 'X-priority' header. ptLow priority corresponds to X-priority=5, ptNormal - X-priority=2, ptHigh - X-Priority=1.  Default is ptNormal.


TPriority type

unit

msMsgCls

declaration

TPriority=(ptLow,ptNormal,ptHigh);

This is the type of the Priority property of TmsMessage component.


ReturnReceipt property

unit

msMsg

applies to

TmsMessage component

declaration

property ReturnReceipt : boolean;

description

Is set to true if the message delivery receipt has been requested.  This may not work with some servers.  Default is false.


Recipients property

example

unit

msMsgCls

applies to:

TmsMessage component

declaration

property Recipients : TmsAddressList;

description

A list of recipients of mail message.  Probably you will be setting only one recipient, but if you wish to address the message to many people, you can set multiple addresses.  You can also use CC and BCC properties for these purposes.  All three properties work the same way, because they all are of the same type: TmsAddressList.   When sending the message, at list one address field either Recipients or CC lists must be set.


Recipients example
The following code adds the address 75231.330@compuserve.com to the list of recipients.  There are two ways to do it:

procedure TForm1.Button1Click(Sender : TObject);

begin

  msMessage1.Recipients.AddAddress('75231.330@compuserve.com','');

end;

or

procedure TForm1.Button2Click(Sender : TObject);

var

  Addr : TmsMailAddress

begin

  Addr:=TmsMailAddress.Create;

  Addr.Address:='75231.330@compuserve.com';

  msMessage1.Add(Addr);

end;

see also examples for CC and BCC properties.


Headers property

example

unit

msMsg;

applies to:

TmsCustomMessage component;

declaration

property Headers : TmsHeaders;

description

A list of headers of the mail message.  Items should be in the format requested by rfc822. TmsMessage component does not do any verification, except when sending a message if you insert the headers which are automatically generated by TmsMessage, when preparing the message for sending using SaveToFile or SaveToStream methods, headers from the Headers property will be discarded.  Use this property only to set additional headers, which are not generated by TmsMessage component.

The following headers are generated by the TmsMessage.SaveToStream method:

From: based on Sender property;

To: based on Recipients property;

CC: based on CC property

Priority: based on Priority property

Return-Receipt: based on ReturnReceipt and Sender properties

Mime-Version: 1.0 hardcoded

Content-Type: based on ContentType property

Content-Transfer-Encoding: based on CharSet property, also on Body properties (see discussion about ContentType property)


Headers exapmle
The following code sets Reply-To header to the name of sender:

msMessage.Headers.Add(Concat(Reply-To: ',msMessage.Sender.Address);


ContentType property

unit

msMsg;

applies to:

TmsCustomMessage component;

declaration:

property ContentType : ShortString;

description

This property makes sense only if Encoding property is set to meMIME.

You should not modify this property directly, it will be set automatically by TmsMessage component.  We did not make it read only because we wanted it to appear in the Object Inspector.  It will help the users to understand better how it works.

But here is the additional information:

It will be auto generated based on the Body and Attachments properties.  There are the following rules:

a) If the body of the message is empty:

if there is only one attachment, then msMessage.ContentType is the same as the ContentType property of this attachment, if there are more than one attachments, then ContentType is multipart/mixed.

b) if the body of the message is not empty:

if there are no attachments, then msMessage.ContentType is text/plain, otherwise - multipart/mixed.

c) If the body of message is not empty, and the attachments are named as follows:  _alt.xxx.. _alt.yyy where xxx and yyy are extensions (for example rtf, htm) ContentType will be multipart/alternative.  This content type requires more explanation and you can read the special section dedicated to the multipart/alternative messages.


TmsMailBase class

properties	methods	events

unit

msMB

declaration

TmsMailBase = class(TagSocket);

description

TmsMailBase is the direct ancestor of two components, included in the Internet mail suite:  TmsSMTP and TmsCustomPOP.  All its properties, methods and events are inherited by these components, also by TmsPOP and TmsRemotePOP components, which descend from TmsCustomPOP.

TmsMailBase implements the windows socket.  It contains the code which are common for all components, it resolves the name of the Server, finds the port for appropriate service and establishes the connection with Server, also closes it, when necessary.


TmsMailBase properties

DefaultPort

LogFileName

OnLine

Server

TimeOut


DefaultPort property

Unit

agSocket

Applies to

TagSocket component;

declaration

property DefaultPort : Cardinal;

description

Default port for the service.  TagSocket attempts to resolve the port number from server using WSAsyncGetServByName function.  If this attempt fails, then DefaultPort property will be used to establish the connection.  Default value for smtp service is 25, for POP3  - 110 and for HTTP - 80.

If your system uses some unique port number, you can supply it with the Server property of the TagSocket component.  Just specify its decimal value after the name of the server, separated by colon, for example:

mail.domain.com:2322


agSocket unit

classes

TagSocket

types

ESocketError

ETimedOutError

ECanceledError


LogFileName property

unit

agSocket

Applies to

TmsMailBase class

declaration

property LogFileName : string;

description

You can use LogFileName property in conjunction with the WriteLogFile method for debugging purposes.  Your application can call WriteLogFile public method to write the contents of the Log : TStringList object.  WriteLogFile method called automatically in the destructor of TmsMailBase class.  If LogFileName is blank, WriteLogFile does not perform any action.


OnLine property

unit

agSocket

applies to:

TmsMailBase class

declaration

property OnLine : boolean;

description

Runtime and read only.  Returns true if socket is open, otherwise returns false.


Server property

example

unit

agSocket

applies to

TmsMailBase class

declaration

property Server : string;

description

Address of the SMTP and POP3 server, depending on service you are going to use.  Your application will make an attempt to connect to this server.  It can have a format 00.00.00 or mail.somehost.com.  In the second case TmsMailBase attempts to resolve the host name using Winsock WSAsyncGetHostByName function.

If you want to use the port which is special for your system and differs from the default values, you can specify it separated by the colon from the name of the server, for example:

mail.somedomain.com:2311

where 2311 is the number of port (decimal).


TimeOut property

example

unit

agSocket

Applies to

TagSocket class and its descendants.

declaration

property TimeOut : Integer;

description

The number of seconds TagSocket or its descendants will be waiting for some event related to the receiving or sending data.  If time expires, ETimedOutError exception will be raised. Default value is 60.


Server example

SMTP.Server:='mail.compuserve.com';

or

SMTP.Server:='179.231.11.1';

In first case will be made an attempt to resolve the host name, in second case the address will be converted directly to IP.


TimeOut example

POP.TimeOut:=120;

Sets the timeout to 2 minutes.


TmsMailBase methods

Cancel

CloseConnection

OpenConnection

WriteLogFile


Cancel method

unit

msMB

applies to

TagSocket class

declaration

procedure Cancel; virtual;

description

Immediately closes connection with server.  If the application is in the process of performing some email related task, ECanceledError exception will be raised.


CloseConnection method

unit

msMB

applies to

TmsMailBase class;

declaration

procedure CloseConnection; virtual;

description

If OnLine is true, i.e. if the socket is open, tries to close the connection gracefully:  Log out from server and close the socket.  If the socket is already closed, does not perform any action.


OpenConnection method

unit

msMB

applies to:

TmsMailBase class;

declaration:

procedure OpenConnection; virtual;

description

performs the following tasks:

1. Calls Winsock WSAStartup procedure which initializes Winsock, then increments an internal counter of WSAStartup calls.  This counter is used when calling WSACleanUp procedure in the destructor of the TmsMailBase class.

2. Tries to resolve remote host Internet address based on the Server property value;

3. Tries to find the port number for the appropriate service.  If fails, uses the default port set in DefaultPort property;

3. Creates socket

4. Connects to the server

5. Logs onto the server


WriteLogFile method

unit

msMB

Applies to

TmsMailBase class

declaration

procedure WriteLogFile;

description

This method is provided for debugging purposes.  It will work only if the LogFileName property  is not blank.  You can call this method after completion of your task to write log file and find out more about the conversation between your application and the server.


TmsMailBase events

OnClosed

OnClosing

OnCancel

OnError

OnOpen


OnClosed event

unit

agSocket

applies to:

TagSocket class;

declaration

property OnClosed : TNotifyEvent;

description

Called after connection has been closed.  You can use this event to perform some action after the closing the connection, e.g. display a message or update the status bar.


OnClosing event

unit

agSocket

applies to:

TagSocket class;

declaration

property OnClosing : TNotifyEvent;

description

Called when TagSocket (or any of its descendants) tries to close the connection.  You can use this event e.g. to display the message Closing connection on the status bar.


OnCancel event

unit

agSocket

applies to:

TagSocket class;

declaration

property OnCancel : TNotifyEvent;

description

Called when you call Cancel method.  Use this event to perform actions if the operation has been canceled.


OnOpen event

unit

agSocket

applies to:

TagSocket class

declaration

property OnOpen : TNotifyEvent;

description

Called when TagSocket (or its descendant) tries to open the connection, when calling OpenConnection method.


OnError event

unit

agSocket

applies to:

TagSocket class;

declaration

property OnError : TmsErrorEvent;

description

Called when an error occurs.  In the Msg parameter the error message will be passed and you will be able to change it, or check for the kind of the error.  Immediately after processing this event the ESocketError exception will be raised.  You can handle this exception in your code.


TmsErrorEvent type

unit

agTypes;

declaration

TmsErrorEvent = procedure(Sender : TObject; var Msg : string) of Object;

description

this is the type of OnError events for the TmsMailBase class, TmsSMTP, TmsPOP and TmsRemotePOP components.


OnInfoUpdated event

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property OnInfoUpdated : TNotifyEvent;

description

This event is called just after the information in the RemoteInfo property has been retrieved.  You can use this event to display appropriate information, or fill in some list to show it to the user.  For example, in the rmdemo application, included in this package the information is filled in the ListView1 as soon as the information about each single item is retrieved, it happens in the OnNextInfoUpdated event but you can fill it in after the information about all items have been retrieved.


MailMessage property

example

unit

msSMTP

applies to:

TmsSMTP component

declaration

property MailMessage : TmsMessage;

description

MailMessage is the message which will be sent when calling either Send or SendMessage methods.  Before calling Send method you have to assign the value to this property.  All the required properties in the MailMessage must be filled in.  If any of the required values is missing, Verify method will raise the exception and the message will be not sent.

You can assign this value at runtime or set it via Object Inspector.


MailMessage example
The following code will assign the value to the MailMessage property of TsmSMTP component and send the message:

procedure TForm1.SendButtonClick(Sender : TObject);

begin

  msSMTP1.MailMessage:=msMailMessage;

  msSMTP1.Send;

end;


Send method

example

unit

msSMTP

applies to

TmsSMTP component

declaration

procedure Send;

description

Sends the single message.  First, opens the connection with server calling OpenConnection method, then sends the message attached to the MailMessage property using SendMessage method and closes connection calling CloseConnection method.

Send method is useful when you are going to send single message.  Of course, you can use this method when sending multiple messages in a row, but if you do that, each time you call the Send method you will be logged on and off from/to SMTP server.  If you want to log to the server once and send multiple messages, then use SendMessage method.


SendMessage method

example

unit

msSMTP

applies to:

TmsSMTP component;

declaration

procedure SendMessage;

description

Sends the message assigned to the MailMessage property of TmsSMTP component.  First calls Verify method to check whether all the necessary properties of MailMessage are set, then formats the message using SaveToStream method if TmsMessage component and sends necessary commands to the server followed by the message itself.  You must be logged into the server to use this method.  If the connection to the server is not open you have to call OpenConnection method first.  If you are going to send just single message, use Send method, SendMessage method is useful if you are planning to send the multiple messages in a row, without closing the connection to the SMTP server.


SendMessage example
The following assumes we have the list of mail messages stored in the MessageList variable which is an instance of TmsMessageList component.  This example shows how to send these messages in a row using SendMessage method.

procedure TForm1.SendAllMessagesButtonClick(Sender : TObject);

var

  i : Integer;

begin

  try

    msSMTP1.OpenConnection;

    for i:=0 to MessageList.Count-1 do

    begin

      msSMTP1.MailMessage:=MessageList[i];

      msSMTP1.SendMessage;

    end;

  finally

    msSMTP1.CloseConnection;

  end;

end;


OnMailSent event

example

unit

msSMTP

applies to:

TmsSMTP component

declaration

property OnMailSent : TNotifyEvent;

description

Called after the successful sent of the message.  You can use this method to display the pop up message, update the status bar or play sound when the message has been sent.


OnMailSend example
The following procedure updates the status bar if the message has been sent successfully:

procedure TForm1.msSMTPOnMailSent(Sender : TObject);

begin

  StatusBar1.SimpleText:='Message has been sent successfully';

end;


OnPrepare event

unit

msSMTP

applies to:

TmsSMTP component

declaration

property OnPrepare : TNotifyEvent;

description

Called just before TmsSMTP starts the formatting of the mail message.  You can display the message on status bar, telling that message preparation is in progress, because sometimes this process can be lengthy, especially if message contains attachments.


OnSending event

unit

msSMTP

applies to:

TmsSMTP component

declaration

property OnSending : TNotifyEvent;

description

Called after the preparation of message is complete, just before sending the message itself.  One of the usages of this method is to display the message, e.g. Sending Message, on the status bar.


Verify method

unit

msMsg

applies to

TmsCustomMessage component;

declaration

procedure Verify;

description

Checks if all the necessary information is provided for outgoing messages.  To be valid outgoing message the instance of TmsMessage component must have filled in the following properties:

The Address field of the Sender property

and at least one Address field in the list of Recipients or CC recipients

If you call Verify method and at least one of these conditions are not satisfied, EMessageError exception will be raised.


OnProgress event

unit

agSocket;

applies to

TagSocket component;

declaration

property OnProgress : TmsProgressEvent;

description

Allows to track the progress for the lengthy events, such as, e.g. for TmsSMTP component - sending the message, for POP components - receiving message and for NNTP component - retrieving an article.  You can use this event to show the progress on the progress bar, or show the percentage of the performed operation.

There are some processes for which it is possible to get the percentage of completed tasks.  In this case Perc parameter of the event handler will contain the number between 0-100.  If it is impossible to figure out the percentage value, for example in Finger protocol, when it is not known in advance the size of received data, the Perc value will return -1 all the time.


TmsProgressEvent type

unit

agTypes

declaration

type

  TmsProgressEvent = procedure(Sender : TObject; Perc : Integer; Transferred : LongInt) of Object;

description

This is a type of OnProgress events of components included in the Internet Mail Suite.  Perc parameter contains the percentage of transferred data, or -1, depending on the character of the process, Transferred parameter contains the number of transferred bytes.


TmsCustomPOP class

properties	methods	events

unit

msPOP

declaration

TmsCustomPOP=class(TmsMailBase)

description

It is the immediate ancestor of TmsPOP and TmsRemotePOP components.  It is the abstract class and holds the properties and methods which are common for its descendants.


TmsCustomPOP properties

DefaultPort

LogFileName

Password

Server

TimeOut

TotalMessages

TotalOctets

UserName


TmsCustomPOP methods

Cancel

CloseConnection

OpenConnection

RetrieveMessage

DeleteMessage


TmsCustomPOP events

OnCancel

OnClosed

OnClosing

OnDeleting

OnError

OnOpen

OnProgress

OnRetrieved

OnRetrieving


MessageList property

unit

msPOP3

applies to

TmsPOP component

declaration

property MessageList : TmsMessageList

description

Run time and read only.  Holds the list of retrieved messages.  This list is filled after you call RetrieveAllMessages method. Each member of this list is a TmsMessage component.  You can access the individual message by the index, e.g. if you want to execute the attachment No 0 to the message No 1 you have to do the following:

msPOP.MessageList[1].ExecuteAttachment(0);


Password property

unit

msPOP3

Applies to

TmsCustomPOP class

declaration

Password : string;

description

This is a password which is required to login into the POP3 server.


UserName property

unit

msPOP3

Applies to

TmsCustomPOP class

declaration

UserName : string;

description

Name of the user in the POP3 server account.  With Password gives the user the access to the POP3 server.


TotalMessages property

unit

msPOP3

applies to

TmsCustomPOP class

declaration

property TotalMessages : Integer;

description

Runtime and read only.  If you try to retrieve this value before the call of OpenConnection method, it will return -1.  If you don't call DeleteMessage method, the TotalMessages property will be the actual number of messages on the server, otherwise it will return the number of the highest available message.  In other words, TotalMessages property is the initial value of available messages in your maildrop.


TotalOctets property

unit

msPOP3

applies to

TmsCustomPOP class

declaration

property TotalOctets : LongInt;

description

Initial total number of octets, in all messages available in your maildrop.  It will return -1 if before your application calls OpenConnection method.


RetrieveMessage method

unit

msPOP3

applies to

TmsCustomPOP class

declaration

procedure RetrieveMessage(MsgNo : Integer)

description

Retrieves the message number MsgNo.  Please keep in mind, that the numeration is 0 based, even thought numeration of messages on the server is 1 based.  To base the numeration on 0 seems to be more natural for Delphi environment.  For TmsPOP component the output goes to the MessageList property, the retrieved message will be added to the list, for TmsRemotePOP component there are two possibilities.  If OnUserMessageSave event is attached, then this event will be executed, otherwise output will be saved in the directory which is assigned to the MessageDirectory property of TmsRemotePOP component.  The file name will be 'msg_##.eml', where ## is IntToStr(MsgNo)


DeleteMessage method

unit

msPOP3

applies to

TmsCustomPOP class

declaration

procedure DeleteMessage(MsgNo : Integer);

description

Directs the POP3 server to delete the message No MsgNo.  Numeration is 0 based.  If the message No MsgNo does not exist, no action will be performed.


OnDeleting event

unit

msPOP3

applies to

TmsCustomPOP class

declaration

property OnDeleting : TmsNumNotifyEvent;

description

TmsCustomPOP calls this method from DeleteMessage method.  You can use this event to display the message on the status bar, e.g. 'Deleting message 7'


TmsNumNotifyEvent type

unit

agTypes

declaration

type

  TmsNumNotifyEvent = procedure(Sender : TObject; Num : Integer) of Object;

description

This is the type of events which need to return the reference to the number of the message which is currently under the process, e.g. for OnDeleting event Num will be the number of the message which is just about to be deleted.


OnRetrieved event

unit

msPOP3

applies to

TmsCustomPOP class

description

property OnRetrieved : TmsNumNotifyEvent

description

Called immediately after the message number Num has been retrieved.


OnRetrieving event

unit

msPOP3

applies to

TmsCustomPOP class

declaration

property OnRetrieving : TmsNumNotifyEvent;

description

Called just before the retrieving the message number Num.


RetrieveAllMessages method

unit

msPOP3

applies to

TmsPOP component

declaration

procedure RetrieveAllMessages(LeaveOnServer : boolean);

description

You can use this single command to retrieve all messages waiting for you on the server.  This method performs the following tasks:

Opens the connection with the POP3 server using OpenConnection method;

Checks if there are any messages waiting and if there are, retrieves them using RetrieveMessage method;

if LeaveOnServer is false, deletes the original messages on the server, calling DeleteMessage method;

Closes the connection with server, calling CloseConnection method.

After calling this method all messages will be stored in the MessageList property.


RemoteInfo property

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property RemoteInfo : TmsRemoteInfo;

description

Contains the list of TmsRemoteInfoItem objects.  Each RemoteInfoItem corresponds to the message which is waiting on the server and contains the information about headers of the message, also its size, subject, sender, date etc.  See TmsRemoteInfoItem class description for more information.


TmsRemoteInfo class

unit

mspop3cl

declaration

  TmsRemoteInfo = class

  private

    { Private declarations }

    FList : TList;

    function GetCount : Integer;

    function GetItem(Index : Integer) : TmsRemoteInfoItem;

  protected

    { Protected declarations }

  public

    { Public declarations }

    constructor Create;

    destructor Destroy; override;

    procedure Clear;

    function Add(Value : TmsRemoteInfoItem) : Integer;

    property Count : Integer read GetCount;

    property Items[Index : Integer] : TmsRemoteInfoItem read GetItem;

         default;

  end;

description

This is the type of the RemoteInfo property of TmsRemotePOP component.  TmsRemoteInfo class is the list of TmsRemoteInfoItem objects.  Each item of this list corresponds to the single message on server.


TmsRemoteInfoItem class

unit

mspop3cl

declaration

  TmsRemoteInfoItem = class

  protected

    Action : TmsActionSet;

    procedure SetMarkedToDelete(Value : boolean);

    function GetMarkedToDelete : boolean;

    procedure SetMarkedToRetrieve(Value : boolean);

    function GetMarkedToRetrieve : boolean;

  public

    Size : LongInt;

    Headers : TmsHeaders;

    constructor Create;

    destructor Destroy; override;

    property MarkedToDelete : boolean read GetMarkedToDelete

               write SetMarkedToDelete;

    property MarkedToRetrieve : boolean read GetMarkedToRetrieve

               write SetMarkedToRetrieve;

  end;

description

TmsRemoteInfoItem is a type of the each item of the RemoteInfo property of TmsRemotePOP component.  When you call UpdateRemoteInfo method of TmsRemotePOP component, the results are returned in the RemoteInfo property, which is the list of RemoteInfoItem objects.  Each item of this list corresponds to single message on the server.  After retrieving the information you can look at Headers and Size fields of each object and according to your criteria  mark each of them for retrieving and/or deleting.  You can just set MerkedToDelete and MarkedToRetrieve boolean properties to do that, or use MarkToDelete, MarkToRetrieve and Reset methods of TsmRemotePOP component.


MarkToDelete method

unit

msPOP3

applies to

TmsRemotePOP component

declaration

procedure MarkToDelete(Index : Integer);

description

Marks the message on the server for deletion.  This method does not delete the message on the server, it even does not send a request.  Message will be deleted only after you call Transfer method and log out from server.


MarkToRetrieve method

unit

msPOP3

applies to

TmsRemotePOP component

declaration

procedure MarkToRetrieve(Index : Integer)

description

Marks the message for retrieving.  Message will be actually retrieved when you call Transfer method.


Reset method (TmsRemotePOP)

unit

msPOP3

applies to

TmsRemotePOP component

declaration

procedure Reset(Index : Integer)

description

Resets the state of the message.  If the message was marked for deletion (using MarkToDelete method) or for retrieving (using MarkToRetrieve method) it's state will be reset and the call to Transfer method of will have no affect on this message.


Transfer method

unit

msPOP3

applies to

TmsRemotePOP component

declaration

procedure TmsRemotePOP.Transfer;

description

If you are logged out from the POP server after calling UpdateRemoteInfo method, logs into the server, goes through the list of messages, containing in the RemoteInfo property and retrieves messages, which have been marked for retrieving and sends to the server a request about deleting messages which have been marked for deletion. After this it closes the connection. Before performing these actions TmsRemotePOP retrieves the headers of messages on the server, as it does in the UpdateRemoteInfo method and compares them with data in the original RemoteInfo property.  The message will be not retrieved or not deleted if Message-ID headers are not the same.  In this case exception will be raised.  It is done to ensure that nothing have been changed on the server between two logins.

To retrieve messages Transfer method calls RetrieveMessage method, to delete them - DeleteMessage method of TmsCustomPOP component.  When retrieving messages if OnUserMessageSave event is attached, this event will be called, otherwise TmsRemotePOP will save the message in the MessageDirectory with names 'msg_#.eml', where # is the 0-based number of messages on the server.


UpdateRemoteInfo method

unit

msPOP3

applies to

TmsRemotePOP component

declaration

procedure UpdateRemoteInfo

description

Connects to the server and fills in RemoteInfo.  Then, it KeepAlive property is set to false, logs out from server. Now you can check the information containing in RemoteInfo property and select the messages you want to delete and/or retrieve.  When you have selected the actions you want to perform with messages, you can call Transfer method.


OnDataTransferred event

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property OnDataTransfered : TNotifyEvent;

description

Called just before exiting form Transfer method.  You can use this event to display information that data has been transfered, to logout from the server, to send retrieved messages to the mailbox or to perform some another action.


OnNextInfoUpdated event

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property OnNextInfoUpdated : TmsNumNotifyEvent;

description

called immediately after the information about the next item has been retrieved, i.e. another item of the RemoteInfo property has been filled in.  The Num parameter indicates the number of the message.  If you want to display the information about the messages visually, it is the right place to update your list.  See rmdemo application included in this package.


OnTransferringData event

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property OnTransferringData : TNotifyEvent;

description

Called just as soon your application calls Transfer method.  You can use this event to display the information that your application is transferring data, or turn the cursor into Hourglass, because if the messages are big, it can take awhile before TRemotePOP retrieves them.  You can also use OnRetrieving, OnDeleting, OnProgress events, inherited from TmsPOP component do indicate the progress.


OnUpdatingInfo event

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property OnUpdatingInfo : TNotifyEvent

description

Called immediately after you call UpdateRemoteInfo method.  You can use this event to display information e.g.:  Updating headers.


OnUserMessageSave event

unit

msPOP3

applies to

TmsRemotePOP component

declaration

property OnUserMessageSave : TmsUserMsgSaveEvent;

description

This is the user defined event for handling retrieved messages while calling Transfer method of TmsRemotePOP component.  By default, if this event is not attached, the ouput of each message will be saved in the MessageDirectory with names msg_#.eml, where # is the 0-based number of message on the server.  But if you attach OnUserMessageSave event, then instead of default handling your event will be executed.  The input parameters of OnUserMessageSave event are Sender, which is the TmsRemotePOP components itself, Num, which is the number of message and Contents, which is TMemoryStream and which contains the raw contents of the message.  Now you can save this stream into the file, redirect it to the database, load it into the TmsMailMessage component and decode "on the fly", store them into TmsMessageList class, or whatever.  This method should be used very carefully, otherwise it can cause a lose of data.


TmsUserMsgSaveEvent type

unit

agTypes

declaration

type

  TmsUserMsgSaveEvent = procedure(Sender : TObject; Num : Integer; Contents : TMemoryStream) of Object;

description

This is a type of OnUserMessageSave event of TmsRemotePOP component.  Sender usually is the TmsRemotePOP component itself, Num is the number of the retrieved message and Contents - the contents of the message itself.


ContentType property (for TmsAttItem)

unit

msMsgCls;

applies to

TmsAttItem class;

declaration

property ContentType : ShortString;

description

This is a MIME type of the attachment.  TmsAttItem checks retrieves the data using GetContentType function.  This will be the default MIME type.  But you can change it before sending the message.  This value will appear in the Content-Type header when you are sending the message.

When receiving the message, ContentType property is set to the one contained in the header of the received message.


ContentTransferEncoding property

unit

msMsgCls;

applies to

TmsAttItem class

declaration

property ContentTransferEncoding : TEncoding;

description

Usually you don't have to use this property.  Before sending the message TmsAttItem will try to figure out which value to choose to set this property based on the ContentType property.  The following rules apply: if ContentType contains string 'TEXT', then ContentTransferEncoding will be etQP, otherwise - etBase64.


TEncoding type

unit

msMsgCls;

declaration

type

  TEncoding = (etNone, etBase64, etQP);

description

type of ContentTransferEncoding property of the TmsAttItem class.  etBase64 corresponds to Base64 MIME encoding, etQP - Qouted-Printable encoding.  etNone - there is no encoding.


FileName property

unit

msMsgCls;

applies to

TmsAttItem class

declaration

property FileName : ShortString;

description

File name of the attachment.  Presently the Internet Mail Suite supports only file attachments, if while decoding the TmsMessage won't find the file name for the attachment, it will assign one itself. On the other hand, while sending the messages, you cannot add the attachment to the TsmMessage component without specifying the file name.


TmsHeaders methods

Contains

GetFieldBody

GetMultiLineFieldBody

Remove


Contains method

unit

msMsgCls

applies to

TmsHeaders class

declaration

function Contains(const ss : string; MatchCase : boolean) : boolean;

description

performs simple parsing of the headers and returns true if at least one header contains the string ss.  If MatchCase is true, then search is case sensitive.


GetFieldBody method

unit

msMsgCls

applies to

TmsHeaders class

declaration

function GetFieldBody(FieldName : string) : string;

description

Returns the body of the header field, without the Field name itself, for example, if one of the lines in TmsHeaders class is

Return-Receipt-To: jdoe@domain.com

the function

GetFieldBody('Return-Receipt-To')

will return

jdoe@domain.com

The search is not case sensitive, you also don't have to pass ':', GetFieldBody function checks for it and adds ':' if it not present.

To retrieve multiline fields, use GetMultiLineFieldBody method.


GetMultiLineFieldBody method

example

unit

msMsgCls

applies to

TmsHeaders class

declaration

procedure GetMultiLineFieldBody(FieldName : string; FieldBody : TStringList);

description

Parses the strings contained in the instance of TmsHeaders class and returns the lines it finds related to the FieldName string.  See the example for more information.


GetMultiLineFieldBody example
assume the message contains the following header:

CC:  John Doe <jdoe@domain.com>, Argosoft <argosoft@interlog.com>

Return-Receipt-To: ao149@torfree.net

CC: janedoe@aol.com (Jane Doe)

the call

GetMultiLineFieldBody('CC',TempStrings);

will fill the Strings property of TempStrings by the following information:

Strings[0]	John Doe <jdoe@domain.com>

Strings[1]	Argosoft <argosoft@interlog.com>

Strings[2]	janedoe@aol.com (Jane Doe)

i.e. all separators will be removed and the method will return the date you can process using the the procedures from msUtils unit.


Remove method

unit

msMsgCls

applies to

TmsHeaders class

declaration

procedure Remove(FieldName : string);

description

Locates and removes all headers FieldName from the TmsHeaders class.


TmsActionSet type

unit

mspop3cl

declaration

type

  TmsAction = (raRetrieve,raDelete);

  TmsActionSet = set of TmsAction;

description

These types are internally, in the TmsRemoteInfoItem class.


msCls unit

objects

TTempFileStream

TLineStream


TTempFileStream class

unit

msCls

declaration

  TTempFileStream = class(TFileStream)

  private

    FFileName : string;

    FFile : file;

  public

    constructor Create;

    destructor Destroy; override;

  end;

description

Used internally by TmsMessageDecoder and TmsMessageEncoder classes to save the memory.  When you create this stream, you don't have to specify the filename, the file will be created in windows temporary directory and will be deleted when destroying the stream.


TLineStream class

unit

msCls

declaration

  TLineStream = class(TMemoryStream)

  private

    FLines : TStringList;

    FCurLine : Integer;

    FBufSize : Word;

    FEOS : boolean;

    procedure SetBufSize(Value : Word);

  protected

    Finished : boolean;

    procedure LoadNextPart;

  public

    constructor Create;

    destructor Destroy; override;

    procedure Reset;

    function GetNextLine : string;

    property BufSize : Word read FBufSize write SetBufSize

                         default $4000;

    property EOS : boolean read FEOS;

 end;

description

Thanks to this class it is possible to have virtually unlimited mime encoded messages.  This class treats the stream as a sequence of lines and allows to retrieve these lines sequentially.


msPars unit

classes:

TmsMessageDecoder

TmsMessageEncoder

type

EMessageParserError


TmsMessageDecoder class

unit

msPars

declaration

  TmsMessageDecoder = class

  private

    { Private declarations }

    FInStream : TLineStream;

    FMailMessage : TmsMessage;

    FGlobalHeaders : TmsHeaders;

    FLocalHeaders : TmsHeaders;

    FBoundary : string;

  protected

    { Protected declarations }

    QP : TQuotedPrintable;

    procedure FillHeaders(Headers : TStrings);

    procedure ProcessError(const ErrMsg : string);

    procedure ProcessHeaders;

    procedure ProcessBody;

    procedure ProcessAttachments;

    procedure ProcessMultiPartMessage;

    procedure ProcessFileMessage;

    procedure ProcessSinglePartMessage;

    procedure ProcessMIMEMessage;

    procedure ProcessNotMIMEMessage;

    procedure Error(Ident : Integer);

  public

    { Public declarations }

    constructor Create(InStream : TStream);

    destructor Destroy; override;

    procedure Process;

    property MailMessage : TmsMessage read FMailMessage write FMailMessage;

//    property OnProgress : TmsProgressEvent read FOnProgress write FOnProgress;

  published

    { Published declarations }

  end;

description

Used internally by TmsMessage component for parsing messages and decoding the attachments, if any.  Called by TmsMessage.LoadFromStream method.

See also TmsMessageEncoder class


TmsMessageEncoder class

unit

msPars

declaration

  TmsMessageEncoder = class

  private

    { Private declarations }

    FInMessage : TmsMessage;

    FStream : TStream;

  protected

    { Protected declarations }

    TempLines : TStringList;

    QP : TQuotedPrintable;

    function MakeUniqueID : string;

    procedure FilterHeaders;

    procedure PrepareBody;

    procedure PrepareAnAttachment(Att : TmsAttItem);

    procedure PrepareGlobalHeaders;

    procedure PrepareMultipartMessage;

    procedure PrepareTextPlainMessage;

    procedure PrepareFileMessage;

    procedure ListHeadersToStream(const ID : string; List : TmsAddressList);

    procedure StringToStream(const s : string);

  public

    { Public declarations }

    constructor Create(InMessage : TmsMessage);

    procedure Process;

    property TheStream : TStream read FStream write FStream;

  published

    { Published declarations }

  end;

description

Used internally by TmsMessage component for preparing the messages before sending them, called by SaveToStream method of TmsMessage component.

See also TmsMessageDecoder class.


EMessageParserError type

unit

msPars

declaration

  EMessageParserError = class(Exception);

description

This exception will be raised if there is an error while encoding or decoding the mail messages.


msMsg unit

classes

TmsCustomMessage

TmsMessage

TmsMessageList

type

EMessageError


EMessageError type

unit

msMsg

declaration

  EMessageError = class(Exception);

description

Exception which will be raised when there is something wrong with your instance of TmsMessage component, e.g. when you are trying to send a message without specifying the address of the sender or recipient.


msMb unit

class

TmsMailBase


ESocketError type

unit

agTypes

declaration

  ESocketError = class(Exception);

description

This is an error typically related to the functions in winsock.dll.


ETimedOutError type

unit

agTypes

declaration

  ETimedOutError = class(Exception)

    constructor Create;

  end;

description

Will be raised is any winsock operation times out.


ECanceledError type

unit

agTypes

declaration

  ECanceledError = class(Exception)

    constructor Create;

  end;

description

Will be raised when user cancels the operation


msPop3 unit

classes:

TmsCustomPOP

TmsPOP

TmsRemotePOP


components

TmsMessage

TmsSMTP

TmsPOP

TmsRemotePOP

TagRas (32 bit only)

TagHTTP


msPop3Cl unit

classes:

TmsRemoteInfoItem

TmsRemoteInfo

types:

TmsAction

TmsActionSet


msUtils unit

functions and procedures:

AddBackSlash

GetContentType

GetFirstPart

GetParameter

PickMailAddress

SplitAddress

MailDateToDateTime


AddBackSlash function

unit

msUtils

declaration

function AddBackSlash(const DirName : string) : string;

description

Used for directory names.  If DirName ends by '\' character, returns DirName itself, if it does not, returns Concat(DirName,'\')


GetFirstPart function

unit

msUtils

declaration

function GetFirstPart(const s : string) : string;

description

Used for advanced parsing of the message headers.  If the header contains several parts, for example:

Content-Disposition:  attachment; name="test.mid"

Returns the 'first part' of the message header.  In this case the call:

GetFirstPart('attachment; name="test.mid"')

will return the word attachment.

See also

GetParameter function.


GetContentType function

unit

msUtils

declaration

function GetContentType(const FileName : string) : string;

description

Returns the MIME content type.  In the 32 bit version the data is taken from the Windows registry, in the 16 bit one it is hardcoded and you might want to modify the source to add more Content-types.


GetParameter function

unit

msUtils

declaration

function GetParameter(const p : string; s : string) : string;

description

Used for advanced parsing of headers.  Returns the sub parameter of the header, for example, if the header body contains the following:

s:='attachment; name="test.zip"'

the call

GetParameter('name',s)

will return test.zip, without quotes.

See also GetFirstPart function.


PickMailAddress procedure

unit

msUtils

declaration

procedure PickMailAddress(const s : string; TheMailAddress : TmsMailAddress);

description

Used internally. Takes the string obtained from the header, assumes this is the address line defined by rfc822 and tries to fill in the fields of TmsMailAddress object.  Currently is able to parse the strings which have the following format:

John Doe <jdoe@domain.com>

jdoe@domain.com (John Doe)

jdoe@domain.com

If the string has different format, it will be assumed that whole string is the Internet address.

See also SplitAddress procedure.


SplitAddress procedure

unit

msUtils

declaration

procedure SplitAddress(const s : string; var Addr, Name : string);

description

Used internally.  Does the same as PickMailAddress procedure, except this one returns two strings: Addr and Name, ie you don't have to initialize the TmsMailAddress object before calling this function.


MailDateToDateTime procedure

unit

msUtils

declaration

procedure MailDateToDateTime(DtStr : string; var DT : TDateTime; var TZ : string);

description

Converts rfc822 date and time string to Delphi TDateTime type variable.  You can use this procedure to extract the date and time of received message.  You don't need to supply the date and time to the messages you are going to send, because SMTP server will do it, though you can do it, adding it to the Headers of TmsMessage component.

Examples of rfc822 date and time strings are:

Wed, 21 Aug 1996 06:58:43 -0400 (EDT)

21 Aug 96 06:58:43 (CET)

The time must be in 24 hour format.  The procedure returns the appropriate TDateTime in DT variable, the string following the time is considered as time zone definition and is returned in the TZ variable.


msSmtp unit

classes

TmsSMTP


TagSocket class

unit

agSocket

declaration

TagSocket = class(TComponent)

description

This is the base class for all components included in the Internet Mail Suite and probably will serve as the common ancestor for all our future products, related to the standard Internet protocols.  All properties, methods and events are inherited by classes which descend from this class.  The following classes and components descend from TagSocket:  TmsMailBase, TmsSMTP, TmsCustomPOP, TmsPOP, TmsRemotePOP.  Almost all properties, methods and events in the TagSocket component are protected.  TagSocket component is so important, that we included the class reference in this help file.

in this help file._Object;reference in this help file.


Contact information

You can contact ArGo Software Design at:

Internet:

Mail:	support@argosoft.com

WWW:	http://www.argosoft.com

Compuserve:	75231,330

Fax:	+1(416)352-5054

Postal mail:	ArGo Software Design

77 Davisville Ave. #2107

Toronto Ontario M4S 1G4

Canada

All comments, questions, suggestions or bug reports are welcome.


TagHTTP component

properties	methods	events

unit

agHTTP

declaration

  TagHTTP = class(TagSocket)

description

This component is not related to the Internet mail.  It implements Hyper Text Transfer Protocol (HTTP, rfc 1945) and allows your applications to retrieve any file on the web.  It can be the HTML document or binary file.

Set URL property to some document or file and call Get method.  The retrieved data will be saved in the Headers and OutStream properties.  Then you can save OutStream into the file, calling, for example OutStream.SaveToFile.  If it the html document, you can call up the browser to have a look on it.  Or use some component which understands HTML and display the pages in your applications.


units
Main units

agConst

agHTTP

agRASAPI

agRASCmp

agSocket

agTypes

agWsock

msConst

msMsg

msMsgCls

msCls

msPars

msMb

msSmtp

msPop3

msPop3Cl

msUtils


TagHTTP properties

DefaultPort

FileName

Headers

InStream

OutStream

PostContentType

Proxy

RAS

TimeOut

URL

WinsockAvailable

WinsockLoaded


methods

Get

GetAuthorized

Head

Post


TagHTTP events

OnOpen

OnClosing

OnClosed

OnCancel

OnError

OnProgress

OnSending

;P__event;P_


FileName property (TagHTTP)

unit

agHTTP

Applies to

TagHTTP component

declaration

property FileName : string

description

Run time and read only.  After parsing URL, FileName is set to the actual name of the file TagHTTP component retrieves.  If there is no file name in the URL, then it will be blank.  For example:

if URL is http://www.interlog.com/~argosoft/ims.gif

after retrieving the file the FileName property will be ims.gif

if URL is http://www.interlog.com/~argosoft

then FileName will be blank.


Headers property (TagHTTP)

unit

agHTTP

applies to

TagHTTP component

declaration

property Headers : TStrings;

description

Run time and read only.  Just before sending the document HTTP server first sends headers with useful additional information.  After calling GET method these headers will be placed in this list.


OutStream property

unit

agHTTP

applies to

TagHTTP component

declaration

property OutStream : TMemoryStream

description

Contains the data to be sent to the HTTP server using Post method.  This stream object, as well as InStream object, is created with the instance of TagHTTP component.

See the example of Post method to find out how to use this property.


URL property

unit

agHTTP

applies to

TagHTTP component

declaration

property URL : string;

description

URL of the document you want to retrieve using TagHTTP component.  It must start with http://.  After you specify URL you can call Get method and retrieve the document or file.

examples of URL are:

http://www.microsoft.com

http://www.interlog.com/~argosoft/ims.gif


Get method

unit

agHTTP

applies to

TagHTTP component

declaration

function Get : Integer;

description

This is the main and only public method of TagHTTP component.  After specifying URL property, just call this method.  TagHTTP will connect to the remote server, retrieve the document specified in URL, savind it into the InStream property and close the connection.  Returns the operation code transmitted by server.

The following code retrieves the contents of the HTML page and save it into the file:

begin

  agHTTP1.URL:='http://www.borland.com';

  agHTTP1.Get;

  agHTTP1.InStream.SaveToFile('borland.html');

end;


Post method

unit

agHTTP

applies to

TagHTTP component

declaration

function Post : Integer;

description

Applies HTTP Post method to the resource.  Can be used for posting form data or sending the files to the server, or for uploading files, if it is supported by servers (not tested).

You should supply the URL to which the Post method will be applied and save the data to be transmitted to OutStream property of TagHTTP component.

Content-type of data by default is application/x-www-form-urlencoded.  If you wish to send more complex data, you should generate it yourself, store into the OutStream and change the PostContentType property to multipart/form-data, as described in rfc1867.

For example, to send the form data:

procedure SendFormData;

var

  Buf : array[0..255] of Char;

begin

  StrCopy(@Buf,'email=archie@argosoft.com&realname=Archie&subscribe=subscribe');

  agHTTP1.OutStream.Write(Buf,StrLen(@Buf));

  agHTTP1.URL:='http://www.argosoft.com/cgi-bin/guestbook.cgi';

  agHTTP1.Post;

end;


OnSending event (TagHTTP)

unit

agHTTP

applies to

TagHTTP component

declaration

property OnSending : TNotifyEvent

description

This event gets invoked when TagHTTP component sends the GET query to the server.  You can use this event, e.g. to display the message on Status Bar: 'Sending query'.


agHTTP unit

objects

TagHTTP


Acknowledgments

Special thanks to Mr.. Brian Milburn, Solid Oak Software, Inc., for extensive testing of components from The Internet Mail Suite and very useful advises.

TagRas component is partially based on the TRasComponent by Mr. Douglas Olender, who kindly agreed to give us the right to use his ideas in the Internet Mail Suite.

Also to Luc Wuyts, Martin Baur, Paul Stohr, John Taylor, Jayson Minard, David Sherman, Alexander Lucke and everyone, who helped to locate bugs in the TSMTP, TPOP3 components and in the Internet Mail Suite, also for advises.


How to register

If you live in Canada, please visit http://www.argosoft.com/canreg.html or send a request to support@argosoft.com for registration information.

The pricing for The Internet Mail Suite is as follows:

Internet Mail Suite Plus	$89.00

Internet Mail Suite Plus	$69.00

Upgrade from IMS to IMS Plus	$20.00

If you are the registered user of at least one of the following our components:

1.TSMTP component (16 bit)

2.TPOP3 component (16 bit)

3.TSMTP component (32 bit)

4.TSMTP component (32 bit)

you can upgrade to the Internet Mail Suite according to the following table:

If you are the registered user of...	Price	Referred below as...

New User	$69.00

1 Component	$50.00	Upgrade 1

2 Components	$35.00	Upgrade 2

3 or 4 Components	$20.00	Upgrade 3

Special competitive upgrade pricing for the registered users of any other Delphi Internet mail components (Internet Solutions Pack, included in Delphi Developer does not count :-)), also pricing for educational purposes are also available. Please contact us to discuss these issues if you think you qualify. (See the end of this document for contact information).

Registered users will receive the complete source code of all units included in the Internet Mail Suite, technical support, the bug fixes and updates, also, if they request, the registered versions of TSMTP and/or TPOP3 components.

These prices are guaranteed until September 01 1997.

To order using credit card

Public Software Library (PsL) handles the credit card orders for us.

The best and easiest way to use the service provided by PsL is to go to their secure registration page, using links from ArGo Software Homepage. at:

http://www.argosoft.com

Alternatively, you can order with MasterCard, Visa, American Express, or Discover from PsL by calling +1-800-2424-PsL (+1-800-242-4775) or +1-713-524-6394 or by FAX to +1-713-524-6398 or by CompuServe Email to 71355,470. You can also mail credit card orders to:

PsL, P.O.Box 35705,

Houston, TX 7723-5705 USA

or send by Internet mail to:  14818@pslweb.com

The above number are for orders only. Any questions about the status of the shipment of the order, refunds, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, etc, must be directed to ArGo Software Design.

To insure that you get the latest version, PsL will notify us the day of your order and we will ship the product directly to you.

When ordering form PsL, you have to provide the following information:

•	Your name;

•	Credit card type and number, expiry date, name on the credit card if it differs from above;

•	Address;

•	Reference number, assigned to the products by PsL (#14818 for the Internet Mail Suite).  If you are upgrading, please mention about it;

•	Email address, if you wish to receive the products by email;

•	Company name, if applicable (optional);

•	Phone and fax numbers (optional).

If you are a CompuServe member

You can register our products via CompuServe shareware registration service. To do it, GO SWREG, select Register Shareware and search the Shareware database using the shareware registration numbers found below, then follow step by step instructions.

Registration # and pricing via CompuServe SWREG service

Product	CompuServe SWREG #	Price (US$)

Internet Mail Suite Plus	15484	$89.00

Internet Mail Suite	12754	$69.00

Upgr. IMS -> IMS Plus	15485	$20.00

Upgrade 1*	12755	$50.00

Upgrade 2*	12756	$35.00

Upgrade 3*	12757	$20.00

*See table above to find out about Upgrade options

To order by check of money order

Print out the registration form contained it the file regform.doc, fill it in and mail along with a check or money order payable to ArGo Software Design to the following address:

ArGo Software Design

77 Davisville Ave. #2107

Toronto Ontario M4S 1G4

Canada

Please do not mail the credit card information to this address.  If you want to order by credit card, use PsL Service (see above).

Contact information:

You can contact ArGo Software Design at:

Internet:

Mail:	support@argosoft.com

WWW:	http://www.argosoft.com

Compuserve:	75231,330

Fax:	+1(416)352-5054

Postal mail:	ArGo Software Design

77 Davisville Ave. #2107

Toronto Ontario M4S 1G4

Canada


Encoding property (TmsMessage)

unit

msMsg;

applies to:

TmsCustomMessage component;

declaration:

property Encoding : TMsgEncoding;

description

indicates which encoding method (MIME/Base64 or UUCode) to use when sending the messages with attachments.  Default value is meMIME.

Please note, that if this property is set to meMIME the attachments will be encoded according to the MIME standards, if it is set to meUU, all attachments, including non-binary ones will be encoded using UUEncode method.


Disclaimer - Agreement

Users of THE INTERNET MAIL SUITE must accept this disclaimer of warranty:

THE INTERNET MAIL SUITE is supplied as is.  The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of THE INTERNET MAIL SUITE.  ArGo Software Design's liability is limited only to the amount actually paid by you.

THE INTERNET MAIL SUITE is a "shareware" and is provided at no charge to the user for evaluation.  Feel free to share it with your friends, but please do not give it away altered or as part of another system. The essence of "user-supported" software is to provide personal computer users with quality software without high prices, and yet to provide incentive for programmers to continue to develop new products.

If you find this VCL useful and wish to obtain the registered version, you must make a registration payment of $69.00 to ArGo Software Design. The $69.00 registration fee will license one copy for use on any one computer at any one time.  You must treat this software just like a book.  An example is that this software may be used by any number of people and may be freely moved from one computer location to another, so long as there is no possibility of it being used at one location while it's being used at another. Just as a book cannot be read by two different persons at the same time.

Site-License arrangements may be made by contacting ArGo Software Design.

Anyone distributing THE INTERNET MAIL SUITE for any kind of remuneration must first contact ArGo Software Design for authorization.

You are encouraged to pass a copy of THE INTERNET MAIL SUITE along to your friends for evaluation.  Please encourage them to register their copy if they find that they can use it.  All registered users will receive a copy of the latest version of the THE INTERNET MAIL SUITE.


Installation

To install the components, included in the Internet Mail Suite,

First, decompress all files files using WinZip (http://www.winzip.com) or pkunzip (http://www.pkware.com).  If you are using pkunzip, use -d switch to keep the original directory structure

If you are using Delphi 3, you can install IMS using two ways.  First, more traditional way is the following:  Start up Delphi, then click Component - Install Component, then click Browse and select the file msreg32.pas (or msreg32.dcu for unregistered version). and install the components in the default container.

You also can install the Internet Mail Suite as a package.  We decided not to include .dpl and .dcp files to keep the size of the distributable file small, since you can generate them from Delphi IDE, so you can't directly use Component - Install Packages option. To install IMS as a separate package, run Delphi 3 IDE, click File - Open and select ims.dpk file, then click Install.  In this case you may need to add IMS path to the Library search path, because Delphi 3 does not seem to be doing it itself.  To do it go click Tools - Environmental Options, select Library path and add to the Library Path the directory where you uncompressed IMS files.  Paths should be separated by semicolon.

If you are using Delphi 1, Delphi 2 or Borland C++ Builder, . then run Delphi and from IDE install the file msreg32.pas.(for 32 bit version) or msreg16.zip (for 16 bit version).

If you are not using Delphi 3, then

The Internet Mail Suite tab should appear on your component palette.

Special installation notes:

In the unregistered version the string table containing winsock error messages will be not merged with the library cmplib.dcl.  The error messages will be loaded from wserr.16 or wserr32.dll files (depending are you using 16 or 32 bit version) which is included with the package.  This is done to avoid 'Duplicate resource identifier' errors.  This error may occur if you are using some 3rd party products which are referring to the same resource identifiers as the Internet Mail Suite.

In the registered version by default the string table containing error messages will be merged with the component library.  If you encounter 'Duplicate resource identifier' errors when installing the Internet Mail Suite, please locate the compiler directive {.$DEFINE USEWSERRDLL} in the msdef.inc file and enable it by removing the period preceding the $ sign.  Or there is another solution - uninstall the components which are using the same resource identifiers as the Internet Mail Suite.

If you are going to use wserrxx.dll files, you can keep them in the same directory as your application or place it into Windows or Windows System directory.  Loading of string from dlls should not affect the speed of your application, because all messages are indicating the error, and presumably the errors will not occur in your applications very frequently :-).

And also, some special instructions: Since the Internet Mail Suite very widely uses try - except blocks it would be good idea to disable break on exception option in the Delphi IDE.  (Tools - Options - Preferences).

Special Instructions for Borland C++ Builder users:

To install the Internet Mail Suite in BCBuilder you may follow the same instructions as for Delphi.  But there are some issues you should keep in mind.

It appears there is a conflict between agwsock.pas unit and winsock.h file by Microsoft, which is supplied with BCBuilder.  The problem is the following:  BCBuilder cannot generate the types containing the keyword unsigned, since this keyword is not used in Object Pascal.

If you compile your projects, you may get Redefinition not identical warnings.  To avoid this warning, you have to disable it by setting #pragma warn -dup.  See sample applications included in the package.

To merge this help

If you are using Delphi 3:

1. Locate the file Delphi3.cfg in \Delphi 3\HELP directory and add the following line in the Third-Party Help section:

:Link ims.hlp

If you are using Internet Mail Suite Plus, then you also will need to add the line:

:Link imsplus.hlp

Then copy the files ims.hlp, ims.cnt and, if you are using IMS Plus, imsplus.hlp into \Delphi3\HELP directory and restart Delphi..

If you are using Delphi1, Delphi2 or Borland C++ Builder, do the following:

1 Run the HELPINST application. HELPINST is a Windows application installed with Delphi.

2. Within HELPINST open the file \Delphi 2.0\Bin\Delphi.hdx (\delphi\bin\delphi.hdx, or whatever).

3. Click Add Keyword file and select ims.kwf.


Multipart/Alternative content type

multipart/alternative type is used by Microsoft Internet Mail 4.0 if you select to use html format messages.  Same format is used by Netscape mail.

Here is how rfc1522 explains this content type::

The multipart/alternative type is syntactically identical to multipart/mixed, but the semantics are different.  In particular,  each of the parts is an "alternative" version of the same information.

Systems should recognize that the content of the various parts are interchangeable.  Systems should choose the "best" type based on the local environment and preferences, in some cases even through user interaction.  As with multipart/mixed, the order of body parts is significant.  In this case, the alternatives appear in an order of increasing faithfulness to the original content. In general, the best choice is the LAST part of a type supported by the recipient system's local environment.

Multipart/alternative may be used, for example, to send mail in a fancy text format in such a way that it can easily be displayed anywhere

You can generate multipart/alternative messages using TmsMessage component

1. Assign the text/plain version of the message to the Body property of TmsMessage component;

2. Create alternative version(s) as file(s).  Name files as _alt.xxx, where xxx can be, for example, html, rtf etc.  The file name must but _alt, otherwise TmsMessage component will generate multipart/mixed message;  The file names in the encoded messages will be suppressed, so you don't have to worry about ugly file names.  This name is used internally by TmsMessage components, just to guess that you are trying that to generate Multipart/Alternative message.

3. Attach _alt.xxx files as attachments.  These files must follow the message body, i.e. the 0th attachment must be _alt.xxx file. Otherwise multipart/mixed file will be generated;

4. If you want to attach another files, do it after attaching all _alt.xxx files.  In this case the Content-Type of the message itself will be multipart/mixed, but the alternative parts will be included as a multipart/alternative subsection;

PLEASE NOTE:  The Internet Mail Suite does not provide any methods to create html or rtf files.  It is your, programmer's responsibility to handle this.

How to decode multipart/alternative messages

1. Save the received message into the stream/file and call TmsMessage.LoadFromStream/File method;

2. If the message does not contain attachments, first section of the message (TmsMessage assumes that first section is text/plain) will be stored in the Body property, the alternative sections will  be stored as attachments.  The TmsMessage.ContentType will be multipart/alternative;  Names will be _alt.# where # is the zero-based number of the message;  It is your responsibility to look up the TmsMessage.Attachments[i].ContentType property and

according to its value (e.g. text/html, text/rtf) choose the section you wish to display;

3. If the message contains attachments, the TmsMessage.ContentType will be multipart/mixed.  The first section of the multipart/alternative section (again, TmsMessage will assume that first section is text/plain) will be stored into TmsMessage.Body property.The following alternative sections will be stored as attachments with names _alt.#, where # is the zero-based number of the message; Again, it is your responsibility to look up the TmsMessage.Attachments[i].ContentType property and choose the section you wish to display;  The 'real' attachments will follow the alternative sections.

Please use this feature with caution, if you need assistance or more information, send mail to argosoft@interlog.com.


agRASCmp unit

classes

TagRas

types

ERasError

TRasNotifyEvent


ERasError type

unit

agRasCmp

declaration

  ERasError = class(Exception);

description

This is an exception which will be raised if RAS related error occurs .


TagRas component

properties	methods	events

32 bit version only!!!

unit

agRasCmp

declaration

TagRas=class(TComponent);

description

TagRas component allows you to control Windows 95 and Windows NT Dial-Up networking.  Use TagRas component to establish the connection with the remote access service (RAS).

To establish the connection, first you have to set Service property.  Entries property contains a list of available services and the name of service you are setting must to the name from this list.  Entries are filled in in the constructor of TagRas component, so this list is available at soon as you create the instance of TagRas component.  If the list of entries is empty then TagRas component will ignore all calls to its methods, assuming Dialup networking is not installed.

To set the service, just assign the valid service name to the Service property. for example:

Service:='CompuServe';

if CompuServe is not contained in Entries property TagRas component will display the error.  If it is in list, you can call Dial method to establish the connection.  To hang up the line call HangUp method.  To cancel the call - call Cancel method.

If you are using TagRas component with components which descend from TagSocket  (such as TmsSMTP, TmsPOP, TmsRemotePOP or TagHTTP) you can set the RAS property of TagSocket to your instance of TagRas component and TagSocket will dial and hang up by itself, when OpenConnection and CloseConnection methods are called.

To do it, drop TagRAS component onto your form, set it's service property from Object inspector, then set the RAS property of your socket component to the instance of your TagRAS component, say msRAS1 the and dialup service will be set up.

Take a look at popdemo.dpr project, which is included in your package.


Entries property

example

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property Entries : TStrings;

description

Run time and read only.  Contains the list of available Dial-Up services.  Used internally by TagRas component, but it is public, so you can use this property to display the names of the services in, e.g. combobox, and allow the users to select the name of appropriate service and use their selection when setting Service property.  If Dial-Up networking is not installed, or services are not set up, Entries will be empty.


Entries example

The following code will display the available services in the combobox:

ComboBox1.Items:=agRas1.Entries;

It would be good idea to set the ComboBox1.Style to csDropDownList, so that users would be not able to type in the names of non-existing services.


Service property

example

32 bit version only!!!

unit

agRasCmp

applies to

TagRas component

declaration

property Service : string;

declaration

Contains the name of Dial-Up service.  The service must be registered with Windows and therefore should be contained in the Entries list, otherwise TagRas component will not allow you to assign the name of the service.

If the name of service is blank, TagRas will assume you don't need to use it and silently ignore all calls to its methods.

Note that you can not set Service property when connection to the remote service is already established.


Service example

The following code assigns sets the dialup service:

agRas1.Service:='CompuServe';


TagRas properties

Entries

ForceService

Installed

MinimizeAtConnect

OwnConnection

Password

RemovePassword

Service

TimeOut


Installed property

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property Installed : boolean;

description

Run time and read only.  Returns true if Entries property contains at least one entry.  Otherwise TagRas assumes that Dial-Up networking is not installed and Installed property will return false.


MinimizeAtConnect property

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property MinimizeAtConnect : boolean;

description

If you set this property to true, after establishing the connection to the remote service the window Connected to... will be minimized.

Important note: this property will work only with English version of Windows, because it uses FindWindow API function to find the window with caption Connected to SomeService, where SomeService is the name of Service.  We were not able to find the way to support international versions.  You will need to modify the source code to support this property in another language versions.


OwnConnection property

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property OwnConnection : boolean;

description

Run time.  Returns true if the connection was established using your application, otherwise OwnConnection is false.  In the latter case if you call HangUp method the TagRas component will assume that the connection was established from another application and will not hang up.  If you want to disconnect from the service even though the connection was not established from your application you have to set this property to true before calling HangUp method.  Value of this property makes sense only after calling Dial method.


HangUp method

32 bit version only!!!

unit

agRasCmp

applies to

TagRas component

declaration

procedure HangUp;

description

Closes the connection with remote access service.  If OwnConnection property is set to false, the method does not perform any action but resetting some internal flags.


Dial method

32 bit version only!!!

unit

agRasCmp

applies to

TagRas component

declaration

procedure Dial;

description

Tries to Dial up the remote access service.  First it checks whether the connection with the particular service is already established (e.g. by another application).  If the connection is already on, then sets OwnConnection to false and exits.  Otherwise dials up the number calling RasDial windows API function.  Note that Dial method is synchronous, i.e. it will not exit until the connection is actually established.


Password property (TagRas)

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property Password : string;

description

This property has meaning only if password is not saved in the Dial-Up connection, which is registered with windows.  To check out if the password is set in the windows connection, go to My Computer, then Dial-Up networking and double click the connection. If password edit box displays *s and Save Password checkbox is checked, then the password is saved and TagRas.Password property will not have any affect if you use this particular connection.  The same applies to RemovePassword property, which has the meaning only if networking password is not saved in windows settings.


RemovePassword property

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property RemovePassword : boolean;

description

Works in conjunction with Password property.  If set to true the password used in your application  will be removed after establishing the connection.


TimeOut property (TagRas)

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property TimeOut : Integer;

description

Used in Dial method.  This is the number of seconds TagRas component will wait when after calling Dial before the connection is established.  After TimeOut seconds TagRas will hang up and raise ETimedOut exception.


Cancel method (TagRas)

32 bit version only!!!

unit

agRasCmp

applies to

TagRas component

declaration

procedure Cancel;

description

Immediately disconnects from the service calling HangUp method.  Note that if OwnConnection property is false, then HangUp method will not disconnect from service, assuming the connection belongs to another application.


TagRas methods

Cancel

Dial

HangUp


GetAuthorized method

unit

agHTTP;

applies to:

TagHTTP component

declaration

function GetAuthorized(const UserName, Password : string) : Integer;

description

Retrieves the document using basic authentication method.  You should supply URL property and

call this methos as if you were calling Get method, but you will need to specify UserName and Password parameters.  Returns the operation code sent be server.


events

OnDisconnected

OnStatusChange


OnDisconnected event

32 bit version only!!!

unit

agRasCmp

applies to

TagRas component

declaration

property OnDisconnected : TNotifyEvent;

description

Called from HangUp method if this method actually hang up the line (in some circumstances it does not).  You can use this event to update the information on the status panel.


OnStatusChange event

32 bit version only!!!

unit

agRasCmp

applies to

TagRas component

declaration

property OnStatusChange : TRasNotifyEvent;

description

Called when the status of the connection changes.  RasStatusStr parameter contains the string indicating the status.  All this strings are coming from rasapi32.dll, which is the part of Windows and you don't have to worry about translating them into different languages.  You can use this event to display the information on the status bar.


TRasNotifyEvent type

unit

agRasCmp

declaration

type

  TRasNotifyEvent : procedure(Sender : TObject; RasStatusString : string) of Object;

description

This is the type of the OnStatusChange event of TagRas component.  RasStatusString contains the string describing the current connection status.


msMsgCls unit

classes

TmsAddressList

TmsAttItem

TmsAttList

TmsHeaders

TmsMailAddress

types

TCharSet

TEncoding

TmsgEncoding

TPriority


Reset method (TmsSMTP)

unit

msSMTP

applies to

TmsSMTP component

declaration

procedure Reset;

description

You rarely will need to use this method.  Sends RSET command to the server.  May be useful to handle exceptions.


ShortString
If you are using 16 bit version,

read string


RAS property

32 bit only!!!

unit

agsocket

applies to

TagSocket class

declaration

property RAS : TagRAS;

description

If this property is assigned, OpenConnection, CloseConnection methods of the descendants of TagSocket class will call Dial and HangUp methods of the assigned of TagRAS component.  I.e. if this property is assigned, if you have Dial-Up networking configured correctly and all necessary properties of TagRAS component are set, you can just assign this property and your application will dial-up the number of the Remote access service, do what you requested and hang up.

If Service property of TagRAS component is blank, or if this property is not assigned, all RAS API calls will be ignored.


KeepAlive property

unit

mspop3

applies to

TmsRemotePOP component

declaration

property KeepAlive : boolean;

description

If this property is set to true, TmsRemotePOP component will not log out from POP server between calls of UpdateRemoteInfo  and Transfer methods.  If you are performing selection of messages quickly, you can set this property to true, but if you stay inactive for some time (this time depends on server) server can time out.  By default this property is set to false.


TMsgEncoding type

unit

msMsgCls

declaration

TMsgEncoding = (meMIME, meUU);

description

This is a type of the Encoding property of TmsMessage component.


Assign method (TmsMessage)
Assign method

unit

msMsg

Applies to

TmsCustomMessage component

declaration

procedure Assign(Value : TPersistent);

description

If Value is not TmsMessage raises exception, if Value is TmsMessage then copies full contents of Value to the TmsMessage component


ForceService property

32 bit version only!!!

unit

agRasCmp

Applies to

TagRas component

declaration

property ForceService : boolean;

description

if this property is true, which is default, TagRAS component will attempt to dial the number if a connection specified in Service property is not active.  If this property is set to false, then TagRAS will try to find out to any service with TCP/IP support is active and if it finds one, will attempt to use active connection without attempting to dial the connection specified in Service property.


Proxy property

unit

agHTTP

applies to

TagHTTP component

declaration

property Proxy : string;

description

Specifies an address of proxy server.  If your application does not use proxy server, you should leave this property blank.  Important:  it has to contain both the address of proxy machine and port, separated by colon (:), without spaces.  You must ensure that the format of this property is correct, there is no error checking in TagHTTP component, except checking for colon.

Examples:

gateway:2010

domain.com:1029

213.222.123:3098


TAgSocket class reference

type

  TagSocket = class(TComponent)

  private

    { Private declarations }

    FServer : string;

    FTimeOut : Integer;

    FLogFileName : string;

    FDefaultPort : word;

    FUnits : TUnits;

    FServiceName : string;

    FProtocol : TmsProtocol;

    FOnOpen : TNotifyEvent;

    FOnConnected : TNotifyEvent;

    FOnClosing : TNotifyEvent;

    FOnClosed : TNotifyEvent;

    FOnCancel : TNotifyEvent;

    FOnProgress : TmsProgressEvent;

    FOnError : TmsErrorEvent;

    FOnLineSent : TmsLineTransmitEvent;

    FOnLineReceived : TmsLineTransmitEvent;

{$IFDEF EMBEDRAS}

    FRAS : TagRas;

{$ENDIF}

    InvWnd : THandle;

    function GetOnLine : boolean;

    function JustServer : string;  {new, if port is forced}

    function PickPort : word; { -"-}

    function GetWinsockLoaded : boolean;

    procedure SetWinsockLoaded(Value : boolean);

    function GetWinsockAvailable : boolean;

    function GetTimeOut : Integer;

    procedure SetTimeOut(Value : Integer);

    procedure DoOpen(Sender : TObject);

    procedure DoConnected(Sender : TObject);

    procedure DoClosing(Sender : TObject);

    procedure DoClosed(Sender : TObject);

    procedure DoCancel(Sender : TObject);

    procedure DoProgress(Sender : TObject; Perc : Integer; Transferred : LongInt);

    procedure DoLineSent(Sender : TObject; const TheLine : string);

    procedure DoLineReceived(Sender : TObject; const TheLine : string);

  protected

    { Protected declarations }

    MyWSAData : TWSAData;

    TheSocket : TSocket;

    AsyncHandle : THandle;

    TC : TTimeCounter;

    ServerInAddr : u_Long;

    ServerIPAddr : string;

    LocalHost : string;

    ThePort : word;

    WsInitCount : Integer;

    Log : TStrings;

    Canceled : boolean;

    HostFound : boolean;

    ServiceFound : boolean;

    Connected : boolean;

    DataHasArrived : boolean;

    ReadyToSend : boolean;

    ConnectionClosed : boolean;

    AsyncError : boolean;

    ErrorNo : word;

    Flags : word;

    TempS : string;

{$IFDEF EMBEDRAS}

    procedure Notification(AComponent : TComponent;

                Operation : TOperation); override;

{$ENDIF}

    procedure Error(Ident : word);

    procedure TimeOutError;

    procedure CanceledError;

    procedure WndProc(var Msg : TMessage);

    procedure ReInit; virtual;

    procedure ResolveRemoteHost;

    procedure GetLocalHost;

    procedure GetService;

    procedure OpenSocket;

    procedure Connect;

    procedure Verify;

    function GetServerReplyCode(const s : string) : Integer; virtual; {11.07}

    function RecvLine(var s : string) : Integer;

    function RecvLines : Integer;

    procedure SendLine(const s : string);

    procedure RecvLineStream(SL : TStream; FullSize : LongInt);

    procedure RecvStream(SL : TStream; FullSize : LongInt);

    procedure SendStream(SL : TStream);

    procedure DoError(Sender : TObject; var Msg : string);

    property Server : string read FServer write FServer;

    property ServiceName : string read FServiceName write FServiceName;

    property Protocol : TmsProtocol read FProtocol write FProtocol;

    property DefaultPort : word read FDefaultPort write FDefaultPort;

    property TimeOut : Integer read GetTimeOut write SetTimeOut default 60;

    property OnOpen : TNotifyEvent read FOnOpen write FOnOpen;

    property OnConnected : TNotifyEvent read FOnConnected write FOnConnected;

    property OnClosing : TNotifyEvent read FOnClosing write FOnClosing;

    property OnClosed : TNotifyEvent read FonClosed write FOnClosed;

    property OnCancel : TNotifyEvent read FOnCancel write FOnCancel;

    property OnProgress : TmsProgressEvent read FOnProgress write FOnProgress;

    property OnError : TmsErrorEvent read FOnError write FOnError;

    property OnLineSent : TmsLineTransmitEvent read FOnLineSent write FOnLineSent;

    property OnLineReceived : TmsLineTransmitEvent read FOnLineReceived write FOnLineReceived;

  public

    { Public declarations }

    constructor Create(AOwner : TComponent); override;

    destructor Destroy; override;

    procedure Open; virtual; {11.4}

    procedure Close; virtual;

    procedure Cancel; virtual;

    procedure WriteLogFile;

    property LogFileName : string read FLogFileName write FLogFileName;

    property OnLine : boolean read GetOnLine;

    property Units : TUnits read FUnits write FUnits; {For progress in NNTP}

    property WinsockAvailable : boolean read GetWinsockAvailable;

  published

    { Published declarations }

    property WinsockLoaded : boolean read GetWinsockLoaded write SetWinsockLoaded

         default false;

{$IFDEF EMBEDRAS}

    property RAS : TagRAS read FRAS write FRAS;

{$ENDIF}

end;


agConst unit

Contains string constants for error messages.  This unit is used by file agconst.rc, which is a stringtable resource file.  You can change the strings in the resource file if you want to display the messages on your native language.  After changing the error messages, you should apply brcc32 or brcc to your rc file.  Both resource compilers shop with Delphi.

The following string constants are defined in agconst.pas unit:

const

  agSBase = 57000;

  agSTimedOut = agSBase;  {Operation Timed Out}

  agSCanceled = agSTimedOut+1; {Operation has been canceled}

  agSServerRequired = agSCanceled+1; {Server property is required}

  agSBadVersion = agSServerRequired+1; {Invalid Winsock version}

  agSResolving = agSBadVersion+1; {Error resolving remote host}

  agSServiceRequired = agSResolving+1; {Service name is required}

  agSProxyPortRequired = agSServiceRequired+1; {Proxy port is required}

  agSInvalidURL = agSProxyPortRequired+1; {Invalid URL format}

  agSNotConnected = agSInvalidURL+1; {You have to connect to the server first}

  agSBusy = agSNotConnected+1; {Server is busy}

  agSFuncNotFound = agSBusy+1; {Function %s not found}

  agSWinsockNotLoaded = agSFuncNotFound+1; {Winsock is not loaded}

  agSWinsockNotFound = agSWinsockNotLoaded+1; {Winsock not found}

  agSAtRequired = agSWinsockNotFound+1; {Invalid query format.  @ symbol does not present}

  agSTimeServerError = agSAtRequired+1; {Server returned invalid reply}

And here is the source of agconst.rc:

#include "agconst.pas"

STRINGTABLE

{

  agSTimedOut, "Operation timed out"

  agSCanceled, "Operation has been canceled"

  agSServerRequired, "Server property is required"

  agSBadVersion, "Invalid Winsock version"

  agSResolving, "Error resolving remote host"

  agSServiceRequired, "Service name is required"

  agSProxyPortRequired, "Proxy port is required"

  agSInvalidURL, "Invalid URL"

  agSNotConnected, "You have to connect to the server first"

  agSBusy, "Server is busy"

  agSFuncNotFound, "Function %s not found"

  agSWinsockNotLoaded, "Winsock is not loaded"

  agSWinsockNotFound, "Winsock not found"

  agSAtRequired, "Invalid query format.  @ symbol not present"

  agSTimeServerError, "Server returned invalid reply"

}

see also msConst.pas, msConst.rc and wserr.rc to translate messages.


WinsockLoaded property

unit

agSocket

Applies to

TagSocket class and its descendants.

declaration

property WinsockLoaded : boolean;

description

Loads or unloads winsock.dll/wsock32.dll.  By default is set to false.  It means you have to set this property to true in your program in order to use the components.  If winsock is not installed on the system, EWinsockDLL exception will be raised, stating that winsock not found.

This property is implemented in the Internet Mail Suite v1.5 or later.  Now you can still use the components included in IMS even if winsock is not installed on the machines.  In the earlier versions it would be impossible to run your applications on the computers without winsock.


Head method

unit

agHTTP

applies to

TagHTTP component

declaration

function Head : Integer;

description

Implements HEAD method of HTTP.  If you need just to retrieve the information about the document on the web, without retrieving the document itself, you can use this method.  Headers property will be filled in and you will be able to parse received data.  Returns the operation code returned by server.


agRASAPI unit

The interface unit containing the declaration of RAS API functions and constants.


agTypes unit

types

ESocketError

ECanceledError

ETimedOutError

TmsErrorEvent

TmsProgressEvent

TmsNumNotifyEvent

TmsUserMsgSaveEvent

TmsLineTransmitEvent


agWsock unit

Winsock.dll interface.  Declares a global variable agWinsock, which always exists.  All winsock functions are declared as the methods of this global variable.

It is out of our scope to describe winsock functions.  agWinsock in addition declares two methods: LoadWinsock and FreeWinsock.  First one tries to load winsock.dll (wsock32.dll), another one frees it.  If winsock is not installed, a EWinsockDll exception will be raised.

agWinsock class also includes one more function:  Loaded, which returns true if winsock is available or false if it is not.


msConst unit

Contains string constants for error messages, mainly related to high level email components.  See agConst unit for more basic message.  This unit is used by file msconst.rc, which is a stringtable resource file.  You can change the strings in the resource file if you want to display the messages on your native language.  After changing the error messages, you should apply brcc32 or brcc to your rc file.  Both resource compilers shop with Delphi.

The following string constants are defined in msconst.pas unit:

const

  agSBase = 57000;

  msSSenderRequired = agSBase+100; {The address of sender is required}

  msSRecipientRequired = msSSenderRequired+1; {At least one Recipient, CC or BCC must be entered}

  msSMailMessageRequired = msSRecipientRequired+1; {MailMessage property must be assigned}

  msSUserNameRequired = msSMailMessageRequired+1; {UserName property is required}

  msSPasswordRequired = msSUserNameRequired+1; {Password property is required}

  msSIDsDiffer = msSPasswordRequired+1; {IDs are different}

  msSMIMEExplanation = msSIDsDiffer+1; {This is a multipart message in MIME format}

  msSUnableToRetrieveHeaders = msSMIMEExplanation+1; {Unable to retrieve headers}

  msSMissingContentType = msSUnableToRetrieveHeaders+1; {Missing required field: Content-Type}

  msSMissingClosingBoundary = msSMissingContentType+1; {Cannot find closing boundary}

  msSMissingBoundary = msSMissingClosingBoundary+1; {Cannot find boundary}

  msSErrorDecoding = msSMissingBoundary+1; {Error Decoding Attachment}

  msSFileNameBlank = msSErrorDecoding + 1;

  msSShellExecFailed = msSFileNameBlank + 1;

  msSArticleRequired = msSShellExecFailed+1; {Article property must be assigned}

  msSNewsGroupRequired = msSArticleRequired+1; {Newsgroup header is required}

  msSSubjectRequired = msSNewsGroupRequired+1; {Subject header is required}

  msSNewsGroupNotSelected = msSSubjectRequired+1; {Newsgroup has not been selected}

And here is the source of msconst.rc:

#include "msconst.pas"

STRINGTABLE

{

  msSSenderRequired, "The address of sender is required"

  msSRecipientRequired, "At least one Recipient, CC or BCC must be entered"

  msSMailMessageRequired, "MailMessage property must be assigned"

  msSUserNameRequired, "UserName property is required"

  msSPasswordRequired, "Password property is required"

  msSIDsDiffer, "IDs are different"

  msSMIMEExplanation, "This is a multipart message in MIME format"

  msSUnableToRetrieveHeaders, "Unable to retrieve headers"

  msSMissingContentType, "Missing required field: Content-Type"

  msSMissingClosingBoundary, "Cannot find closing boundary"

  msSMissingBoundary, "Cannot find boundary"

  msSErrorDecoding, "Error decoding the attachment"

  msSFileNameBlank, "Unable to execute attachment #%d\nbecause file name is blank"

  msSShellExecFailed, "Error executing ShellExec.  Error code %d"

  msSArticleRequired, "Article property must be assigned"

  msSNewsGroupRequired, "Newsgroup header is required"

  msSSubjectRequired, "Subject header is required"

  msSNewsGroupNotSelected, "Newsgroup has not been selected"

}

see also agConst.pas, agConst.rc and wserr.rc if you need to change these messages.


TmsCustomMessage component

Base class for TmsMessage component.  Implemented in v1.5 to expand TmsMessage component for Usenet Articles.  See TmsMessage component for details about TmsCustomMessage component.


WinsockAvailable property

unit

agSocket

Applies to

TagSocket class and its descendants.

declaration

property WinsockAvailable : boolean;

description

Runtime and read only.  Returns true if winsock.dll/wsock32.dll found on the system.  Otherwise returns false.


OnConnected event

unit

agSocket

applies to:

TagSocket component

declaration

property OnConnected : TNotifyEvent;

description:

Triggered when connection to the server has been establishes and TagSocket is waiting for reply.


PostContentType property

unit

agHTTP

applies to

TagHTTP component

declaration

property PostContentType : string;

description

Post method of HTTP requires that you supply the content-type of the data you are posting.  In the majority of cases it would be application/x-www-form-urlencoded, which is default value, but there is also new type of content-type applicable to post method, called mutlipart/form-data, described in rfc1867.  It is recommended for uploading the files to the servers, or sending complex data.

If you are going to use this second option, you should set the PostContentType property to multipart/form-data and format the contents of OutStream property appropriately, as described in rfc1867.  This feature has not been tested with TagHTTP component.


InStream property

unit

agHTTP

applies to

TagHTTP component

declaration

property InStream : TMemoryStream

description

That's where the received data will be stored if you use Get method of TagHTTP component.  After calling Get method you can save the retrieved data to file, e.g. calling TagHTTP.InStream.SaveToFile() method...


OnLineSent event

unit

agSocket

applies to:

TagSocket class;

declaration

procedure OnLineSent : TmsLineTransmitEvent;

description

Published only in TagFTP component.  Triggered when the command string is sent to the server. TheLine parameter contains the transmitted line.  Along with OnLineReceived event, is useful for creating logs, to track the conversation with server.


OnLineReceived event

unit

agSocket

applies to:

TagSocket class;

declaration

procedure OnLineReceived : TmsLineTransmitEvent;

description

Published only in TagFTP component.  Triggered when the reply is received from the server. TheLine parameter contains the received line.  Along with OnLineSent event, is useful for creating logs, to track the conversation with server.


TmsLineTransmitEvent type

unit

agTypes;

declaration

  TmsLineTransmitEvent = procedure(Sender : TObject; const TheLine : string) of Object;

desription

The type of OnLineReceived and OnLineSent events of TagSocket class.  Published only for TagFTP component.